// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request';
import {
    DeleteMessageTemplateInput,
    GenAuthUrlInput,
    SignatureInput,
    WechatPayOutput,
    WechatUserLogin,
    MessageTemplateSendInput, 
} from '../models';
// 定义 API 路径枚举
enum Api {
    SysWechatDeleteMessageTemplate = '/sysWechat/deleteMessageTemplate',
    SysWechatGenAuthUrl = '/sysWechat/genAuthUrl',
    SysWechatGenConfigPara = '/sysWechat/genConfigPara',
    SysWechatMessageTemplateList = '/sysWechat/messageTemplateList',
    SysWechatOpenIdLogin = '/sysWechat/openIdLogin',
    SysWechatSendTemplateMessage = '/sysWechat/sendTemplateMessage',
    SysWechatSnsOAuth2 = '/sysWechat/snsOAuth2',
}

// 定义 API 方法
export const apiSysWechatDeleteMessageTemplatePost = (body?: DeleteMessageTemplateInput) =>
    request({
        url: Api.SysWechatDeleteMessageTemplate,
        method: 'post',
        data: body,
    });

export const apiSysWechatGenAuthUrlPost = (body?: GenAuthUrlInput) =>
    request({
        url: Api.SysWechatGenAuthUrl,
        method: 'post',
        data: body,
    });

export const apiSysWechatGenConfigParaPost = (body?: SignatureInput) =>
    request({
        url: Api.SysWechatGenConfigPara,
        method: 'post',
        data: body,
    });

export const apiSysWechatMessageTemplateListGet = () =>
    request({
        url: Api.SysWechatMessageTemplateList,
        method: 'get',
    });

export const apiSysWechatOpenIdLoginPost = (body?: WechatUserLogin) =>
    request({
        url: Api.SysWechatOpenIdLogin,
        method: 'post',
        data: body,
    });

export const apiSysWechatSendTemplateMessagePost = (body?: MessageTemplateSendInput) =>
    request({
        url: Api.SysWechatSendTemplateMessage,
        method: 'post',
        data: body,
    });

export const apiSysWechatSnsOAuth2Post = (code: string) =>
    request({
        url: `${Api.SysWechatSnsOAuth2}?Code=${code}`,
        method: 'post',
    });